<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 600px;
            height: 350px;
            border: 10px solid pink;
            margin: 30px auto;
            display: flex;
            flex-direction: column;
        }

        .box>ul {
            height: 80px;
            display: flex;
        }

        .box>ul>li {
            flex: 1;
            background-color: skyblue;
            color: #fff;
            font-size: 34px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
        }

        .box>ul>li.active {
            background-color: orange;
        }

        .box>ol {
            flex: 1;
            position: relative;
        }

        .box>ol>li {
            width: 100%;
            height: 100%;
            position: absolute;
            left: 0;
            top: 0;
            display: none;
            justify-content: center;
            align-items: center;
            background-color: purple;
            color: #fff;
            font-size: 100px;
        }

        .box>ol>li.active {
            display: flex;
        }
    </style>
</head>

<body>
    <div class="box" id="box">
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ul>
        <ol>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ol>
    </div>
    <div class="box" id="box1">
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ul>
        <ol>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ol>
    </div>
    <div class="box" id="box2">
        <ul>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ul>
        <ol>
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
        </ol>
    </div>
    <script src="./tab.js"></script>
    <script>
    new Tabs('#box','click');
    new Tabs('#box1','mouseover');
    new Tabs('#box2','dblclick')
    </script>
</body>

</html>